<template>
  <el-container id="system-box">
    <el-header
      >阿里妈妈车位租赁超级管理系统<span id="now-user"
        >欢迎您，{{ myname }} <span id="quit" @click="tui">退出登录</span></span
      ></el-header
    >
    <el-container>
      <el-aside width="200px"><AdminsNav></AdminsNav></el-aside>
      <el-main><router-view></router-view></el-main>
    </el-container>
    <el-footer></el-footer>
  </el-container>
</template>

<script>
import AdminsNav from "../../components/superAdmins/SuperAdminsNav";
const jwt = require("jsonwebtoken");
import { TOKEN_KEY } from "../../../../node-parking/utils/const";
export default {
  components: {
    AdminsNav,
  },
  computed: {
    myname() {
      return jwt.verify(localStorage.token, TOKEN_KEY).username;
    },
  },
  methods: {
    tui() {
      localStorage.clear();
      this.$router.push("/superAdminsLogin");
    },
  },
};
</script>

<style lang="scss">
#system-box {
  height: 100vh;
  .el-header {
    height: 50px;
    background: lightgreen;
    line-height: 50px;
    font-size: 30px;
    font-weight: bolder;
    #now-user {
      float: right;
      font-weight: bold;
      font-size: 20px;
      #quit {
        color: red;
        &:hover {
          cursor: pointer;
        }
      }
    }
  }
  .el-footer {
    height: 50px;
    background: lightgreen;
  }
}
</style>